package com.wiscamp.ninechapters.panels.application.assemblers;


import com.wiscamp.ninechapters.panels.application.command.CreatePermissionCommand;
import com.wiscamp.ninechapters.panels.application.command.UpdatePermissionCommand;
import com.wiscamp.ninechapters.panels.application.vo.PermissionVO;
import com.wiscamp.ninechapters.panels.application.vo.SimplePermissionVO;
import com.wiscamp.ninechapters.panels.domain.entities.Permission;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface PermissionAssembler {
    PermissionAssembler Instance = Mappers.getMapper(PermissionAssembler.class);

    PermissionVO toPermissionVO(Permission entity);

    SimplePermissionVO toSimplePermissionVO(Permission entity);

    Permission fromCreateCommand(CreatePermissionCommand createCommand);

    Permission fromUpdateCommand(UpdatePermissionCommand updateCommand);

}
